package com.vae.learn.feignclient;

import com.vae.content.domain.entity.CoursePublish;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * 使用content模块提供的接口，也就是在learn模块远程调用content模块的接口
 */
@FeignClient(value = "content-api",fallbackFactory = ContentServiceClientFallbackFactory.class)
@Service
public interface ContentServiceClient {

    @ResponseBody
    @GetMapping("/content/r/coursepublish/{courseId}")
    CoursePublish getCoursepublish(@PathVariable("courseId") Long courseId);
    @ResponseBody
    @GetMapping("/content/r/getTeachplanByCourseId/{courseId}")
    Map<Integer, String> getTeachplanByCourseId(@PathVariable("courseId") Long courseId);

    @ResponseBody
    @GetMapping("/content/r/getTeachplanIsPreview/{teachplanId}")
    Boolean getTeachplanIsPreview(@PathVariable("teachplanId") Long teachplanId);


}